package com.rds.workflow.service;


import com.rds.workflow.domain.RdaWfNode;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;

public interface IRdaWfNodeService {


    /**
     * 修改流程列表节点
     *
     * @param rdaWfNode 流程节点
     * @return 结果
     */
    public int updateRdaWfNode(RdaWfNode rdaWfNode);

    /**
     * 修改流程列表节点
     *
     * @param workflowid 流程列表id
     * @param stateid 状态id
     * @param nodeType 节点类型：0 开始,1 中间节点,-1 结束节
     * @return 结果
     */
    public int updateRdaWfNodeByStateid(Long workflowid, Long stateid, Long nodeType, Date startTime);

    /**
     * 根据流程列表id更新下节点状态
     * @param workflowid 流程列表id
     * @param stateid 状态id
     * @param startTime 开始时间
     * @return 结果
     */
    public int updateRdaWfNodeByToStateid(Long workflowid,Long stateid,String responseType);


    public List<RdaWfNode> selectRdaWfNodebyUser(Long workflowid);

    public RdaWfNode selectRdaWfNodebyInfo(Long id);

    public RdaWfNode selectRdaWfNodebyById(Long id);
    /**
     * 查询流程列表节点列表
     *
     * @param rdaWfNode 流程列表节点
     * @return 流程列表节点集合
     */
    public List<RdaWfNode> selectRdaWfNodeList(RdaWfNode rdaWfNode);

    /**
     * 查询流程节点列表
     *
     * @param workflowid 流程节点
     * @return 流程节点集合
     */
    public List<RdaWfNode> selectRdaWfNodeTemplete(Long workflowid,String operationType);

    public RdaWfNode selectRdaWfNodeStartOrEnd(@Param("workflowid") Long workflowid, @Param("nodeType") Long nodeType);

    /**
     * 修改流程列表节点
     *
     * @param id 节点id
     * @param stateid 状态
     * @return 结果
     */
    public int updateRdaWfNodeStateid(Long id,Long stateid);

    /**
     * 删除流程列表节点
     *
     * @param workflowid 流程id
     * @return 结果
     */
    public int deleteRdaWfNodeByWorkflowid(Long workflowid);

    /**
     * 修改流程列表节点
     *
     * @param workflowid 流程id
     * @param stateid 状态id
     * @param stateids 状态id
     * @return 结果
     */
    public int updateRdaWfNodeByStateids(Long workflowid,Long stateid,String stateids);

    /**
     * 根据节点id查询该节点上级节点
     *
     */
    public List<RdaWfNode> selectRdaWfNodeByFromIdList(Long nodeId,String operationType);

    /**
     * 将所有完成状态的节点重置为创建状态并将开始时间重置为空
     *
     * @param rdaWfNode 流程节点
     * @return 结果
     */
    public int updateRdaWfNodeByStartTime(RdaWfNode rdaWfNode);

    /**
     * 根据流程列表id更新下节点状态
     * @param workflowid 流程列表id
     * @param stateid 状态id
     * @param startTime 开始时间
     * @return 结果
     */
    public int updateRdaWfNodeByNodeIdEnd(Long workflowid,Long stateid,String responseType,Date startTime);

    /**
     * 修改流程列表节点拒绝后跳过完成节点
     *
     * @return 结果
     */
    public int updateRdaWfNodeByRejectskipcomplete(Long id,boolean Rejectskipcomplete);
}
